// cover some element-ui styles

.el-breadcrumb__inner,
.el-breadcrumb__inner a {
  font-weight: 300 !important;
}

.el-upload {
  input[type='file'] {
    display: none !important;
  }
}

.el-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.el-upload__input {
  display: none;
}

.cell {
  .el-tag {
    margin-right: 0px;
  }
}

.small-padding {
  .cell {
    padding-left: 5px;
    padding-right: 5px;
  }
}

.fixed-width {
  .el-button--mini {
    padding: 7px 10px;
    width: 60px;
  }
}

.status-col {
  .cell {
    padding: 0 10px;
    text-align: center;

    .el-tag {
      margin-right: 0px;
    }
  }
}

.el-alert {
  &--warning.is-light {
    color: #dd8b20;
    .el-alert__description {
      color: #dd8b20;
    }
  }
  & &__description {
    margin: 0;
  }
  &__title + &__description {
    margin-top: 5px;
  }
}

.el-badge {
  & + &,
  & + .el-button {
    margin-left: 10px;
  }
  &__content {
    border-width: 2px;
    padding: 3px 4px;
    display: inline-flex;
    align-items: center;
    &.is-fixed {
      z-index: 1;
    }
  }
}

.el-button-group.is-vertical {
  display: inline-flex;
  flex-direction: column;
  > .el-button {
    border-radius: 0;
    border: 0;
  }
  > .el-button:not(:last-child) {
    margin-right: 0;
    margin-bottom: -1px;
  }
  > .el-button:not(:first-child) {
    margin-right: 0;
  }
  > .el-button:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
}

.el-radio {
  display: inline-flex;
  align-items: center;
  &.is-bordered {
    padding: 0 10px;
  }
  &__label {
    padding-left: 5px;
  }
  &-button__inner {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
}

.el-button {
  $last-rule: &;
  i {
    font-size: inherit;
  }
  & [class*='em-icon-'] + span {
    margin-left: 5px;
  }
  &--small:not(#{$last-rule}--text):not(.is-round):not(.is-round) {
    padding-top: 9px;
    padding-bottom: 9px;
    border-radius: 4px;
  }
  &--flex {
    display: inline-flex;
    align-items: center;
  }
  &--square {
    position: relative;
    padding: 0 !important;
    &::after {
      content: '';
      padding-top: 100%;
      display: block;
    }
    > * {
      position: absolute;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    &[class*='--small'] {
      width: 31.8px;
      font-size: 16px;
    }
    &[class*='--mini'] {
      width: 30px;
    }
  }
  &--xs {
    padding: 2px 4px;
    font-size: 12px;
    border-radius: 3px;
    &.is-circle {
      padding: 2px;
    }
  }
}

.el-tree-node__label {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

// to fixed https://github.com/ElemeFE/element/issues/2461
.el-dialog {
  transform: none;
  left: 0;
  position: relative;
  margin: 0 auto;
  max-width: 750px;
  @media screen and (orientation: portrait) {
    width: 100%;
    height: 100% !important;
    margin-top: 0 !important;
  }
}
.scrollbar-dialog {
  .el-dialog {
    height: 70vh;
    display: flex;
    flex-direction: column;
    .el-dialog__footer,
    .el-dialog__header {
      padding: 20px;
    }
    .el-dialog__body {
      flex: 1;
      overflow: hidden;
      padding: 0;
      border-top: 1px solid #eee;
      border-bottom: 1px solid #eee;
    }
    .el-scrollbar__view {
      padding: 15px;
    }
  }
}

// refine element ui upload
.upload-container {
  .el-upload {
    .el-upload-dragger {
      // width: 100%;
      // padding: 20px;
      // height: 200px;
      display: flex;
      align-items: center;
      justify-content: center;
      .d-flex {
        flex-direction: column;
        .el-icon-upload {
          margin-top: 0;
          line-height: 1;
        }
      }
    }
  }
}

// dropdown
.el-dropdown-menu {
  a {
    display: block;
  }
}

// fix date-picker ui bug in filter-item
.el-range-editor.el-input__inner {
  display: inline-flex !important;
}

.el-menu-item,
.el-submenu__title {
  height: 44px;
  line-height: 44px;
}

.el-submenu {
  .el-menu-item {
    height: 40px;
    line-height: 40px;
  }
}

.user-block {
  .username,
  .description {
    display: block;
    margin-left: 50px;
    padding: 2px 0;
  }

  .username {
    font-size: 16px;
    color: #000;
  }

  .description {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.2);
  }

  :after {
    clear: both;
  }

  .el-avatar {
    float: left;
  }

  span {
    font-weight: 500;
    font-size: 12px;
  }
}

.adjust-drawer {
  .el-drawer__header {
    span {
      font-size: 20px;
      font-weight: bold;
      color: #333;
    }
  }
  .el-drawer__body {
    min-height: 0;
    .el-form {
      height: 100%;
    }
    .el-container.is-vertical {
      height: 100%;
    }
    .el-main {
      padding: 0;
      .el-scrollbar__view > * {
        padding: 0 20px;
      }
    }
    .el-header,
    .el-footer {
      padding-top: 15px;
      padding-bottom: 15px;
    }
    .el-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .el-scrollbar {
      .el-form {
        padding: 0 15px;
      }
    }
  }
}

.radio-group-pill {
  display: flex;
  flex-wrap: wrap;
  .el-radio-button {
    margin-bottom: 10px;
    margin-right: 10px;
    &__inner {
      border: 1px solid #dcdfe6;
    }
    &:last-child {
      margin-right: 0;
    }
    .el-radio-button__inner {
      border-radius: 4px;
      box-shadow: none;
    }
    &--small {
      margin-bottom: 8px;
      margin-right: 8px;
    }
    &--large {
      margin-bottom: 12px;
      margin-right: 12px;
    }
  }
}

.el-radio.is-bordered {
  margin-right: 0;
}

.el-table {
  .cell {
    overflow: initial;
    line-height: initial;
    .el-badge__content {
      border: none;
      transform: translateY(-50%) translateX(100%) scale(0.8);
    }
  }
  &-column--selection {
    .cell {
      padding-left: 10px;
      padding-right: 10px;
    }
  }
  .no-border {
    border-right: 0;
  }
}
.el-table__body {
  .cell {
    .em-cell {
      padding-left: 0;
      padding-right: 0;
      background-color: transparent;
    }
    .el-form-item {
      margin: 10px 0;
    }
    .el-button--text {
      padding-left: 0;
      padding-right: 0;
    }
    .el-input-number--medium {
      max-width: 100%;
    }
  }
  .table-media-column {
    .cell {
      display: flex;
      align-items: center;
      * + .media-body {
        margin-left: 8px;
      }
      .em-goods-card {
        padding-left: 0;
        padding-right: 0;
        background-color: transparent;
        width: 100%;
      }
    }
    &--flex-column {
      .cell {
        flex-direction: column;
      }
    }
  }
}

input[type='hidden'].el-input__inner {
  height: 0;
  line-height: 0;
}

.el-page-header {
  margin-bottom: 22px;
}

.el-step {
  // &s--simple {
  //   background-color: $--color-primary-light-9;
  //   border: 1px solid $--color-primary-light-8;
  // }
  &__icon {
    background-color: #f0f6ff;
    width: 5rem !important;
    height: 5rem !important;
    &.is-text {
      border: none;
      background-color: #fff;
    }
    &-inner {
      border-radius: 50%;
      border: 1px solid currentcolor;
      width: 60%;
      height: 60%;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }

  &__head.is-wait &__icon-inner {
    border-color: $--border-color-base;
  }

  &__head.is-finish &__icon-inner {
    background-color: $--color-primary-light-8;
    border-color: $--color-primary-light-6;
  }

  &.is-horizontal .el-step__line {
    top: 50%;
    height: 1px;
    background-color: #ececec;
    overflow: hidden;
  }
  &__description {
    font-family: $font-family-thin;
    opacity: 0.6;
  }

  &.is-simple &__icon {
    width: 3.5rem !important;
    height: 3.5rem !important;
    &-inner {
      width: 90%;
      height: 90%;
      border-radius: 10px;
    }
  }

  &.is-simple &__arrow {
    transform: scale(0.6);
  }
}

.text-left .el-input .el-input__inner {
  text-align: left;
}

.form-item__static {
  &.el-form-item .el-form-item {
    margin-bottom: 22px;
  }
}

.el-message-box--center {
  .el-message-box__btns {
    margin-top: 20px;
  }
  .el-message-box__title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .el-message-box__status {
    padding-right: 0;
    margin-bottom: 20px;
  }
  .el-message-box__status.em-icon-authority {
    color: $--color-danger;
    font-size: 2rem !important;
  }
}

.el-pagination {
  > *:last-child {
    margin-right: 0;
    margin-left: 10px;
  }
  > *:first-child {
    margin-left: 0;
    margin-right: 10px;
  }
  &--small {
    padding-left: 0;
    padding-right: 0;
  }
}
